package com.reeygu.cli.command;

import lombok.Data;
import picocli.CommandLine;

/**
 * @describe: 聚合所有子命令
 * @author: ReeyGu
 * @data: 2024/3/29 19:27
*/

@CommandLine.Command(name = "base", version = "1.0", mixinStandardHelpOptions = true)
public class BaseCommand implements Runnable{
    private final CommandLine commandLine;

    {
        commandLine = new CommandLine(this)
                .addSubcommand(new ConfigCommand())
                .addSubcommand(new ListCommand())
                .addSubcommand(new GeneratorCommand());
    }

    @Override
    public void run() {
        System.out.println("Please enter the correct command!");
    }

    /**
     * @describe: 执行命令
     * @author: ReeyGu
     * @data: 2024/3/29 19:34
    */
    public void doCommand(String[] ages) {
        commandLine.execute(ages);
    }
}
